<template>
  <CompOperate
      :field="field"
      :designer="designer"
      :parent-list="parentList"
      :design-state="designState"
      :parent-widget="parentWidget"
      :sub-form-row-id="subFormRowId"
      :sub-form-row-index="subFormRowIndex"
      :sub-form-col-index="subFormColIndex"
      :index-of-parent-list="indexOfParentList"
      :display-style="field.options.displayStyle"
  >
    <div class="waiting-screen-content">
      <div class="waiting-screen-content__content">
        <el-table
            border
            stripe
            class="table-area"
            :data="dataList"
        >
          <el-table-column
              prop="title"
              label="科室"
          >
            <template v-slot="scope">
              心脏内科
            </template>
          </el-table-column>
          <el-table-column
              prop="menuName"
              label="诊室"
          >
            <template v-slot="scope">
              血管内一科
            </template>
          </el-table-column>
          <el-table-column
              prop="date"
              label="正在就诊"
          >
            <template v-slot="scope">
              A026 鬻熊
            </template>
          </el-table-column>
          <el-table-column
              prop="date"
              label="等待就诊(36人)"
          >
            <template v-slot="scope">
              A031 陈庆之
            </template>
          </el-table-column>
        </el-table>
      </div>
    </div>
  </CompOperate>
</template>

<script>
import emitter from "@/utils/designer/emitter";
import mixin from "@sc/templateDetails/modules/homeMiddle/fieldMixin";
import CompOperate from "@c/public/form-designer/devType/modules/compOperate.vue";

export default {
  name: "waiting-screen-content-widget",
  componentName: "FieldWidget", //必须固定为FieldWidget，用于接收父级组件的broadcast事件
  mixins: [emitter, mixin],
  props: {
    field: Object,
    parentWidget: Object,
    parentList: Array,
    indexOfParentList: Number,
    designer: Object,

    designState: {
      type: Boolean,
      default: false,
    },

    dataList: {
      type: Array,
      default: () => [{}, {}, {}, {}, {}],
    },

    subFormRowIndex: {
      /* 子表单组件行索引，从0开始计数 */ type: Number,
      default: -1,
    },
    subFormColIndex: {
      /* 子表单组件列索引，从0开始计数 */ type: Number,
      default: -1,
    },
    subFormRowId: {
      /* 子表单组件行Id，唯一id且不可变 */ type: String,
      default: "",
    },
  },
  components: {
    CompOperate,
  },
  computed: {
    showDoctor() {
      if (!this.field.options["screenConfig"]) return;
      return this.field.options["screenConfig"].defaultShowRow.includes(
          "showDoctor"
      );
    },
    showVisitsNum() {
      if (!this.field.options["screenConfig"]) return;
      return this.field.options["screenConfig"].defaultShowRow.includes(
          "showVisitsNum"
      );
    },
  },
  beforeCreate() {
    /* 这里不能访问方法和属性！！ */
  },

  created() {
    this.registerToRefList();
    this.initEventHandler();
    this.handleOnCreated();
  },

  mounted() {
    this.handleOnMounted();
  },

  methods: {},

  destroyed() {
    this.unregisterFromRefList();
  },
};
</script>

<style lang="scss" scoped>
.table-area{
  table tr{
    height: 120px;
  }
  table td{
    font-size: 32px;
    div {
      width: auto;
      margin: 0 auto;
      text-align: center;
      color: #000000;
    }
    .el-button{
      font-size: 32px;
    }
  }
}
</style>